function alpha = sample_alpha(data,U,V,T)
NR = size(data,1);

nu0 =1;
nu0_ = nu0 + NR

W0 = 1;
df = 0;
for it = 1:size(data,1)
    UU = U(:,data(it,2));
    VV = V(:,data(it,3));
    TT = T(:,data(it,1));
    df = df + (double(data(it,4))-(UU.*VV)'*TT).^2 ;
end
W0_ = 1./(inv(W0)+df)
alpha = wishrnd(nu0_,W0_);